import cv2
import numpy as np

img = cv2.imread('img/example.png')
logo = cv2.imread('img/hqyj.png')
h1, w1, _ = logo.shape
# 水印二值化
_, binary = cv2.threshold(logo, 127, 255, cv2.THRESH_BINARY)
# 创建图片大小的新矩阵
img_new = np.zeros(img.shape, dtype=np.uint8)
# 水印内容赋给新矩阵
img_new[0: h1, 0: w1] = binary
# 原图与水印图片做按位或
result = cv2.bitwise_or(img, img_new)
cv2.imshow('', mat=result)
cv2.waitKey(0)